//
//  HMStatusBottomView.swift
//  WymanWeibo
//
//  Created by wyman on 16/4/14.
//  Copyright © 2016年 wyman. All rights reserved.
//

import UIKit

class HMStatusBottomView: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
        
        //添加UI
      prepareUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    private func prepareUI(){
    
        //添加
        addSubview(retweetButton)
    
        addSubview(commentButon)
        addSubview(likeButton)
        addSubview(sepatorViewFirst)
        addSubview(sepatorViewlast)

    
        
        //设置约束
        
        retweetButton.snp_makeConstraints { (make) in
            make.leading.top.bottom.equalTo(self)
        }
        
        commentButon.snp_makeConstraints { (make) in
            make.leading.equalTo(retweetButton.snp_trailing)

            make.top.bottom.equalTo(self)
            
            make.width.equalTo(retweetButton)
        }
        
        likeButton.snp_makeConstraints { (make) in
            make.trailing.top.bottom.equalTo(self)
            
            make.leading.equalTo(commentButon.snp_trailing)
            make.width.equalTo(retweetButton)

        }
        
        sepatorViewFirst.snp_makeConstraints { (make) in
           make.centerY.equalTo(retweetButton)
            make.centerX.equalTo(retweetButton.snp_trailing)
        }
        
        sepatorViewlast.snp_makeConstraints { (make) in
            make.centerY.equalTo(commentButon)
            make.centerX.equalTo(commentButon.snp_trailing)
        }
 
    
    }
    
  
    
    
    
    //懒加载
    private lazy var retweetButton: UIButton = UIButton.init(image: "timeline_icon_retweet", title: "转发")
    
    //评论按钮
    private lazy var commentButon: UIButton = UIButton.init(image: "timeline_icon_comment", title: "评论")
    
    //赞一个按钮
     private lazy var likeButton: UIButton = UIButton.init(image: "timeline_icon_unlike", title: "赞")
    
    //分割线
    private lazy var sepatorViewFirst:UIImageView = UIImageView(imageName: "timeline_card_bottom_line")
    
    private lazy var sepatorViewlast:UIImageView = UIImageView(imageName: "timeline_card_bottom_line")
}
